package com.vonchange.purchase.dr.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vonchange.purchase.dr.service.IDRGoodService;
import com.vonchange.purchase.good.bean.Good;
import com.vonchange.purchase.good.dao.IGoodDao;
import com.vonchange.utils.crud.dao.IBaseDao;
import com.vonchange.utils.crud.service.dr.impl.DRServiceImpl;
import com.vonchange.utils.pinyin.PinyinUtil;
import com.vonchange.utils.string.StringUtil;
@Service
@Transactional
public class DRGoodServiceImpl extends DRServiceImpl<Good> implements IDRGoodService{
    @Resource
	private IGoodDao goodDao; 
	@Override
	public IBaseDao<Good> getDao() {
		// TODO Auto-generated method stub
		return goodDao;
	}
    public void initSave(Good bean){
		 String name=bean.getName();
		 if(null==bean.getPinyin()||StringUtil.isNotBlank(bean.getPinyin())){
			 bean.setPinyin(PinyinUtil.toHanYuPinyinStringFirstLetter(name));
		 }		 
	}
    public void initUpdate(Good bean){
    }


}
